* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #5b8db8;
    --secondary: #a1c4d0;
    --surface: #fff;
    --emphasis: #eef3f6;
    --text-primary: #333;
    --text-secondary: #777;
    --background: #f9f9f9;
    --link: var(--primary);
    --link-hover: #3c6e91;
    --border: #ddd;
    --transition: 0.3s ease;
}

:root.dark-theme {
    --primary: #7ab3e0;
    --secondary: #88b9c5;
    --surface: #2d2d2d;
    --emphasis: #2d3748;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --background: #1a1a1a;
    --link: #7ab3e0;
    --link-hover: #a1d1f7;
    --border: #404040;
}

body {
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    line-height: 1.7;
    background-color: var(--background);
    color: var(--text-primary);
    font-size: 18px;
    transition: background-color var(--transition);
}

header {
    background-color: var(--surface);
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0px;
}

img {
    vertical-align: middle;
}

a {
    color: var(--link);
}

a:hover {
    color: var(--link-hover);
}

.container {
    width: 65%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

section {
    margin-bottom: 70px;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    transition: transform var(--transition);
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: scale(1.2);
}

.profile-info {
    flex: 1;
}

.profile-info h1 {
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 10px;
    font-family: 'Merriweather', serif;
    color: var(--primary);
}

.profile-info .chinese-name {
    font-weight: 400;
    font-size: 1.4rem;
    color: var(--secondary);
}

.profile-info .subtitle {
    font-size: 0.95rem;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.profile-info p {
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.profile-info .icon {
    margin-right: 5px;
    color: var(--text-secondary);
}

.profile-info a:not(.button) {
    color: var(--link);
    text-decoration: none;
    transition: color var(--transition);
}

.profile-info a:not(.button):hover {
    color: var(--link-hover);
}

.links {
    margin-top: 12px;
}

.links a {
    margin-right: 10px;
    margin-bottom: 7px;
}

.button {
    display: inline-block;
    padding: 6px 10px;
    background-color: var(--primary);
    color: var(--surface);
    border-radius: 5px;
    text-decoration: none;
    margin-top: 7px;
    font-size: 0.85rem;
    transition: background-color var(--transition);
}

.button:hover {
    background-color: var(--link-hover);
}

.carousel-container {
    width: 20%;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 5px;
    border: 1px solid var(--border);
}

.carousel-image {
    display: none;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.carousel-image.active {
    display: block;
}

.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px;
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
    border: none;
    user-select: none;
    border-radius: 50%;
    transition: all var(--transition);
}

.prev {
    left: 8px;
}

.next {
    right: 8px;
}

.prev:hover,
.next:hover {
    background-color: var(--link-hover);
    color: var(--surface);
}

.intro {
    color: var(--text-primary);
    background-color: var(--emphasis);
    padding: 25px 0;
    margin-bottom: 40px;
    border-radius: 5px;
}

.intro p {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.intro p:last-child {
    margin-bottom: 0;
}

main h2 {
    font-size: 1.4rem;
    margin-top: 70px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    color: var(--primary);
}

main h2:first-of-type {
    margin-top: 40px;
}

.date {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--text-secondary);
    display: block;
}

.education-item .education-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    font-size: 0.8rem;
}

.education-item{
    margin-bottom: 25px;
}

.education-introduction {
    margin-top: 10px;
}

.education-introduction p {
    font-size: 0.9rem;
    line-height: 1.6;
}

.experience-item,
.project-item,
.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 35px;
    gap: 20px;
    background-color: var(--surface);
    padding: 20px;
    border-left: 4px solid var(--primary);
    border-radius: 5px;
    font-size: 0.8rem;
}

.experience-item .date,
.project-item .date,
.activity-item .date {
    font-size: 0.75rem;
    margin-top: 5px;
}

.details,
.details-with-logo {
    margin-top: 10px;
    flex: 1;
    margin-left: 0px;
}

.details h3,
.details-with-logo h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: flex-start;
    margin-bottom: 5px;
}

.details p,
.details-with-logo p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.logo {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    margin-top: 5px;
}

.details-with-logo p {
    margin-left: 50px;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.awards-list,
.skills-list {
    list-style-type: none;
    margin-left: 20px;
    padding: 0;
}

.awards-list li {
    position: relative;
    padding-right: 110px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.awards-list .date {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 0.9rem;
}

ul {
    list-style-type: disc;
    margin-top: 10px;
    padding-left: 20px;
}

ul li {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

footer {
    background-color: var(--surface);
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    margin-top: 60px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

footer a {
    color: var(--link);
    text-decoration: none;
}

footer a:hover {
    color: var(--link-hover);
}

footer p {
    margin-bottom: 7px;
}

@media (max-width: 1080px) {
    .container {
        width: 90%;
        padding: 10px;
    }

    header {
        padding: 10px 0;
        margin-bottom: 0;
    }

    .profile-info p {
        font-size: 0.85rem;
    }

    .profile-info h1 {
        font-size: 1.5rem;
        text-align: center;
    }

    .header-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .carousel-container {
        width: 30%;
        height: auto;
        margin-top: 15px;
        position: relative;
    }

    .carousel-image {
        height: auto;
    }

    .prev,
    .next {
        top: 50%;
        transform: translateY(-50%);
    }

    main h2 {
        font-size: 1.2rem;
    }

    .details,
    .education-introduction,
    .details-with-logo {
        margin-left: 20px;
    }

    .details h3,
    .details-with-logo h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .details p,
    .details-with-logo p {
        font-size: 0.9rem;
    }

    .details-with-logo p {
        margin-left: 0px;
    }

    .logo {
        margin-top: 0px;
    }

    .education-item,
    .experience-item,
    .project-item,
    .activity-item {
        flex-direction: column;
        gap: 10px;
    }

    body {
        line-height: 1.6;
    }
}
